package reflect;

import java.lang.reflect.Method;

public class ReflectDemo05 {
    public static void main(String[] args) throws Exception{


        //实例化
        Class cls = Class.forName("reflect.Person");
        Object o = cls.newInstance();
        //调用方法
        Method method = cls.getMethod("say", String.class, int.class);
        method.invoke(o,"嘿蠤",8);
    }
}
